//
//  AddCell.m
//  Travel assistant
//
//  Created by 杨帆 on 16/3/1.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "AddCell.h"

#define kwidth [UIScreen mainScreen].bounds.size.width

#define kheight [UIScreen mainScreen].bounds.size.height

@implementation AddCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addViews];
    }
    
    return self;
}


-(void)addViews{
    
    
    self.imageV.frame = CGRectMake(kwidth*0.02, 10, kwidth*0.03, 20);
    self.lab.frame = CGRectMake(kwidth*0.1, 10, kwidth*0.3, 20);
    self.nameLab.frame = CGRectMake(kwidth*0.3, 10, kwidth*0.42, 20);
    
    
    self.lab.textAlignment = NSTextAlignmentLeft;
    //    self.nameLab.backgroundColor = [UIColor greenColor];
    self.nameLab.textAlignment = NSTextAlignmentRight;
    
    [self.contentView addSubview:self.imageV];
    
    [self.contentView addSubview:self.lab];
    
    [self.contentView addSubview:self.nameLab];
    
    
    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
}



-(UIImageView *)imageV{
    
    
    if (!_imageV) {
        _imageV = [UIImageView new];
    }
    return _imageV;
}

-(UILabel *)lab{
    
    if (!_lab) {
        _lab = [UILabel new];
    }
    return _lab;
    
}


-(UILabel *)nameLab{
    
    
    if (!_nameLab) {
        _nameLab = [UILabel new];
    }
    return _nameLab;
}

-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    self.imageV.frame = CGRectMake(kwidth*0.05, 10, kwidth*0.08, 20);
    self.lab.frame = CGRectMake(kwidth*0.13, 10, kwidth*0.3, 20);
    
    self.nameLab.frame = CGRectMake(kwidth*0.5, 10, kwidth*0.42, 20);
    
}








- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
